var mapIds = [867200810];
var 准备地图 = 867200850;

function init() {}

function setup(c, a) {
    em.setProperty("state", 1);
    em.setProperty("leader", "true");
    var c = em.newInstance("莫奈德_地图_Act1.6_收集资源");
    for (var b = 0; b < mapIds.length; b++) {
        var d = c.setInstanceMap(mapIds[b])
    }
    return c
}

function onItemPickedUp(c, b, d) {
    var a = b.getItemAmount(d);
    if (d == 4036373 && a == 5) {
        b.getAPI().addPopupSay(9400590, 3000, "#face0#你的命不止一条吗？", "", 0);
        b.getAPI().addPopupSay(9400590, 3000, "#face0#真是的……我一个人行动还安全些！", "", 0);
        b.getAPI().addPopupSay(9400590, 3000, "#face0#对我来说，自己才是最重要的，知道吗。", "", 0);
        b.getAPI().addPopupSay(9400582, 3000, "#face0#明白-既然有你这样的人，也该有我们这样的人啊。", "", 0);
        b.getAPI().addPopupSay(9400590, 3000, "#face0#算你有爱心。", "", 0)
    } else {
        if (d == 4036374 && a == 5) {
            b.getAPI().addPopupSay(9400590, 3000, "#face0#该死，我越想越无语！我为啥要这样辛苦啊？那高傲自大的可汗村长在干嘛？", "", 0);
            b.getAPI().addPopupSay(9400582, 3000, "#face0#我也想问呢~~整天嚷嚷着别忘记任务的巴特勒副团长现在在干嘛~~", "", 0);
            b.getAPI().addPopupSay(9400582, 3000, "#face0#啊！他莫非又在向总部申请支援？", "", 0);
            b.getAPI().addPopupSay(9400590, 3000, "#face0#嘿嘿嘿，你这小子真跟我臭味相投。", "", 0)
        }
    }
    if (b.haveItem(4036373, 20) && b.haveItem(4036374, 20)) {
        b.updateInfoQuest(64037, "chk=1");
        b.getAPI().addPopupSay(9400582, 3000, "#face0#搞定了！快回村吧。", "", 0)
    }
}

function onPlayerRegistered(b, a) {
    a.setReviveCount(-100);
    b.startEventTimer(30 * 60 * 1000)
}

function onPlayerRevived(b, a) {
    return false
}

function onMapChanged(c, b, a) {
    if (mapIds.indexOf(a) < 0) {
        on玩家退场(c, b, false);
        return
    }
    em.setProperty("kill", "0");
    em.setProperty("clear", "0");
    em.setProperty("curMap", a)
}

function onPlayerDisconnected(b, a) {
    on玩家退场(b, a, false);
    return 0
}

function onTimeOut(a) {
    a.getPlayers().forEach(function (b) {
        on玩家退场(a, b, true)
    })
}

function onMonsterKilled(a, b) {}

function onPlayerRevived(b, a) {
    return false
}

function onPartyDisbanded(a) {}

function onPlayerKilled(b, a) {}
var setupTask;

function randomNum(b, a) {
    switch (arguments.length) {
        case 1:
            return parseInt(Math.random() * b + 1, 10);
            break;
        case 2:
            return parseInt(Math.random() * (a - b + 1) + b, 10);
            break;
        default:
            return 0;
            break
    }
}

function initProp(a, b) {
    if (em.getProperty(a) == null) {
        em.setProperty(a, b)
    }
}

function initPropArray(a, d, c, e) {
    for (var b = c; b <= e; b++) {
        if (em.getProperty(a + "_" + b) == null) {
            em.setProperty(a + "_" + b, d)
        }
    }
}

function on玩家退场(c, b, a) {
    c.disposeIfPlayerBelow(a ? 999 : 0, 准备地图);
    em.getProperties().clear();
    em.setProperty("state", 0);
    em.setProperty("leader", "true");
    c.unregisterPlayer(b)
};